home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
other
/
ioblixdevkit
/
autodocs
/
ioblixpar.doc
< prev
next >
Wrap
Text File
|
1999-05-14
|
14KB
|
394 lines
TABLE OF CONTENTS
ioblixpar.device/AllocECPInfo
ioblixpar.device/CMD_CLEAR
ioblixpar.device/CMD_FLUSH
ioblixpar.device/CMD_READ
ioblixpar.device/CMD_RESET
ioblixpar.device/CMD_START
ioblixpar.device/CMD_STOP
ioblixpar.device/CMD_WRITE
ioblixpar.device/FreeECPInfo
ioblixpar.device/GetChipInfo
ioblixpar.device/OpenDevice
ioblixpar.device/PDCMD_QUERY
ioblixpar.device/PDCMD_SETPARAMS
ioblixpar.device/AllocECPInfo ioblixpar.device/AllocECPInfo
NAME
AllocECPInfo -- get the IEEE1284 probing information
SYNOPSIS
epi = AllocECPInfo(ioRequest)
D0 A0
struct ECPProbeInformation *AllocECPInfo( struct IORequest * );
FUNCTION
Modern parallel port devices are able to send some information about
themself back to the controlling machine. These information include
manufacturer, model, command sets, current state, etc.
The information block contains all these data in parsed form as well as
the string that was originally read from the device.
INPUTS
ioRequest - pointer to a valid ioRequest after a successfull
OpenDevice() call.
RESULTS
epi - pointer to struct ECPProbeInformation, or NULL if the call
failed. If connected device is IEEE1284 compatible then
epi->epi_IsIEEE1284Compatible will be TRUE and the other fields
contain all the data that where read from the device.
EXAMPLE
/* try to get ECP probe information */
struct IORequest *ioreq;
struct ECPProbeInformation *epi;
if (!OpenDevice(IOBLIXPAR_NAME, 0, ioreq, 0) {
if (epi = AllocECPInfo(ioreq)) {
if (epi->epi_IsIEEE1284Compatible) {
printf("device %s was manufactured by %s\n",
epi->epi_Description, epi->epi_Manufacturer);
} else {
printf("no IEEE1284 compatible device found\n");
}
FreeECPInfo(epi);
} else {
printf("AllocECPInfo() failed\n");
}
CloseDevice(ioreq);
}
SEE ALSO
ioblixpar.device/CMD_READ, FreeECPInfo
ioblixpar.device/CMD_CLEAR ioblixpar.device/CMD_CLEAR
NAME
Clear -- clear the parallel port buffer
FUNCTION
This command just RTS's (no buffer to clear)
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_CLEAR (05)
ioblixpar.device/CMD_FLUSH ioblixpar.device/CMD_FLUSH
NAME
Flush -- clear all queued I/O requests for the parallel port
FUNCTION
This command purges the read and write request queues for the
parallel device. The currently active request is not purged.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_FLUSH (08)
ioblixpar.device/CMD_READ ioblixpar.device/CMD_READ
NAME
Read -- read input from parallel port
FUNCTION
This command causes a stream of characters to be read from the
parallel I/O register. The number of characters is specified in
io_Length. The EOF and EOL modes are supported, but be warned that
using these modes can result in a buffer overflow if the proper
EOL or EOF character is not received in time. These modes should
be used only when the sender and receiver have been designed to
cooperate. A safety guard can be implemented to EOF by setting
io_Length to a maximum allowed value. That cannot be done with EOL
since the EOL mode is identified by io_Length=-1.
The ioblixpar.device has no internal buffer; if no read request has
been made, pending input (i.e. handshake request) is not
acknowledged.
ioblixpar.device does IEEE1284 reads. This means if the connected
device is not IEEE1284 compatible io_Error will be set to
ParErr_NotIEEE1284. On success the unparsed data will be returned in
io_Data with io_Length set to the amount of data read.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_READ (02)
io_Flags If IOF_QUICK is set, driver will attempt Quick IO
io_Length number of characters to receive.
io_Data pointer where to put the data.
RESULTS
io_Error -- if the Read succeded, then io_Error will be null.
If the Read failed, then io_Error will contain an error code.
SEE ALSO
ioblixpar.device/PDCMD_SETPARAMS, ioblixpar.device/AllocECPInfo
ioblixpar.device/CMD_RESET ioblixpar.device/CMD_RESET
NAME
Reset -- reinitializes the parallel device
FUNCTION
This command resets the parallel device to its freshly initialized
condition. It aborts all I/O requests both queued and current and
sets the devices's flags and parameters to their boot-up time
default values. At boot-up time the PTermArray is random, and it
will be so also here.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_RESET (01)
RESULTS
Error -- if the Reset succeded, then io_Error will be null.
if the Reset failed, then the io_Error will be non-zero.
ioblixpar.device/CMD_START ioblixpar.device/CMD_START
NAME
Start -- restart paused I/O over the parallel port
FUNCTION
This command restarts the current I/O activity on the parallel
port by reactivating the handshaking sequence.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_START (07)
SEE ALSO
ioblixpar.device/CMD_STOP
ioblixpar.device/CMD_STOP ioblixpar.device/CMD_STOP
NAME
Stop -- pause current activity on the parallel device
FUNCTION
This command halts the current I/O activity on the parallel
device by discontinuing the handshaking sequence. The stop and
start commands may not be nested.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_STOP (06)
SEE ALSO
ioblixpar.device/CMD_START
ioblixpar.device/CMD_WRITE ioblixpar.device/CMD_WRITE
NAME
Write -- send output to parallel port
FUNCTION
This command causes a stream of characters to be written to the
parallel output register. The number of characters is specified in
io_Length, unless -1 is used, in which case output is sent until
a zero byte occurs in the data. This is independent of, and may be
used simultaneously with setting the EOFMODE in io_ParFlags and using
the PTermArray to terminate the read or write.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_WRITE (03)
io_Flags If IOF_QUICK is set, driver will attempt Quick IO
io_Length number of characters to transmit, or if set
to -1 send until zero byte encountered
io_Data pointer to block of data to transmit
RESULTS
io_Error -- If the Write succeded, then io_Error will be null.
If the Write failed, then io_Error will contain an error code.
SEE ALSO
ioblixpar.device/PDCMD_SETPARAMS
ioblixpar.device/FreeECPInfo ioblixpar.device/FreeECPInfo
NAME